shr.defineClass("shr.holiday.ClearholidayLimitList", shr.framework.List, {
	initalizeDOM: function() {
		shr.holiday.ClearholidayLimitList.superClass.initalizeDOM.call(this);
		var that = this;
		//jQuery("#grid").jqGrid('setFrozenColumns');

	},
	/* 	getGridCustomParam: function() {
			var effectDate = $("#effectDate").val();
			return {
				'effectDate': $("#effectDate").val()
			};
		}, */
	getCustomFilterItems: function() {
		var that = this;
		var filterStr = "";
		var effectDate = $("#effectDate").val();
		var name = '调休假'
		//初始化
		if (name != null && name != "") {
			filterStr += "and holidayType.name = '" + name + "' ";
		}
		if (effectDate != null && effectDate != "") {
			filterStr += "and effectDate = '" + effectDate + "' ";
		}

		//去掉第一个and
		filterStr = filterStr.substring(3);

		return filterStr;
	},
	queryAction: function() {
		var that = this;
		var filterStr = that.getCustomFilterItems();
		//this.setGridCustomParam();
		$("#grid").jqGrid('option', 'page', 1);
		$("#grid").jqGrid("option", "filterItems", filterStr).jqGrid("reloadGrid");
		//jQuery("#grid").jqGrid('setFrozenColumns');
	},
	/**
	 * 清除额度
	 */
	clearAction: function() {
		var that = this;
		var billId = $("#grid").jqGrid("getSelectedRows");
		if (billId == undefined || billId.length == 0) {
			shr.showInfo({
				message: '请选中行'
			});
			return;
		}
		var ids = [];
		for (var i = 0; i < billId.length; i++) {
			ids.push($("#grid").jqGrid("getCell",billId[i], "id"));
		}
		if (ids.length > 0) {
			ids = ids.join(",")
		}
		ids=ids+','
		console.info(billId)
		console.info(ids)
		shr.showConfirm('确定清除额度么？', function() {
			that.remoteCall({
				method: 'clearHoliday',
				param: {
					billId: ids
				},
				success: (function(res) {
					if(res!=null && res!=''){
						shr.showInfo({
							message:"清除额度成功"
						})
					}
	
				})
			})
		})

	}

});
